package com.example.studyproject.mapstruct;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * @program: StudyProject
 * @description: 实体转换
 * @author: kangwei
 * @create: 2023-03-26 10:38
 **/
//@Mapper(componentModel = "spring")
public interface UserMapper {

    UserMapper INSTANCE = Mappers.getMapper(UserMapper.class);

    @Mapping(source = "pwd", target = "userPwd")
    UserDTO getUserDTO(User user);

    @Mapping(source = "pwd",target = "userPwd")
    List<UserDTO> getListUserDTO(List<User> user);
}
